"""
考勤 响应体 模型
"""

from datetime import (
    date,
    time,
)
from typing import (
    List,
    Optional,
)

from pydantic import (
    BaseModel,
    Field,
)

from schema.base_schema.restful import OKWithPage


class AttendanceListData(BaseModel):
    """ 考勤数据 Model """

    attendance_date: date = Field(..., title="考勤日期")
    status: int = Field(..., title="考勤状态")
    clock_in: Optional[time] = Field(..., title="上班打卡时间")
    clock_out: Optional[time] = Field(..., title="下班打卡时间")
    day_type: str = Field(..., title="日期类型")
    weekday: int = Field(..., title="周几")
    need_work_hour: float = Field(..., title="应出勤小时数")


class AttendanceListResponse(OKWithPage):
    """ 考勤数据列表 响应体 """

    data_list: List[AttendanceListData] = Field(..., title="分页后的考勤数据")
